package utilOffice

import (
	"fmt"
	"github.com/xuri/excelize/v2"
)

func ExcelRead(file string, sheet string) (rows [][]string, err error) {

	if "" == sheet {
		sheet = "Sheet1"
	}
	f, err := excelize.OpenFile(file)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer func() {
		// Close the spreadsheet.
		if err = f.Close(); err != nil {
			return
		}
	}()

	rows, err = f.GetRows(sheet)
	return
}
